<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./js/vue.js"></script>
</head>

<body>

  <div id="app">
    请输入成绩：<input type="text" v-model="sorce" @input="test">
    <h2>{{msg}}</h2>
  </div>

  <script>
    new Vue({
      el: "#app",
      data: {
        sorce: "",
        msg: ""
      },

      methods: {
        test () {

          if (this.sorce >= 90) {
            this.msg = "成绩优秀";
          } else if (this.sorce >= 75) {
            this.msg = "成绩良好";
          } else if (this.sorce >= 60) {
            this.msg = "成绩及格";
          } else {
            this.msg = "成绩不及格";
          }

        }
        
      }
    })
  </script>

</body>

</html>